<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>用户登录</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="keywords" content="Flat Dark Web Login Form Responsive Templates, Iphone Widget Template, Smartphone login forms,Login form, Widget Template, Responsive Templates, a Ipad 404 Templates, Flat Responsive Templates" />
    <script type="text/javascript" src="js/jquery-2.1.0.js"></script>

</head>
<body>
<script>
    $(function() {

        var firmloginbtn = $('#firmloginbtn');
        firmloginbtn.click(function () {
            var studentId = $("input[name = 'username']").val();
            var password = $("input[name = 'pwd']").val();
            $.ajax("/user/login",{
                type:"post",
                data:{
                    'studentId':studentId,
                    'password':password
                },
                success:function(data){
//                      在这里注册成功后跳转页面
                    console.log(data);

                    if(data == "false"){
                        alert("登录失败");
                    }else {
                    window.location.href = "librarylist.html";
                    }
                },
                error:function(){
                }
            })
        });



    });



</script>

<h1>图书系统登录</h1>
<div class="login-form">
    <input type="text" class="text" value="Username" name="username" onFocus="this.value = '';" onBlur="if (this.value == '') {this.value = 'Username';}" >
    <div class="key"><input type="password" value="Password" name="pwd" onFocus="this.value = '';" onBlur="if (this.value == '') {this.value = 'Password';}"></div>
    <div class="signin" id="firmloginbtn"><input type="submit" value="Login" ></div>
</div>
</body>
</html>